/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package titanisu.basicMathModule1.FractionLessthanGreaterThan;

import java.util.ArrayList;
import java.util.Random;

/**
 *
 * @author Balaji
 */
public class QuestionGeneratorAddSub {

    ArrayList quest = new ArrayList();

    private void setQ(ArrayList arlst) {
        this.quest = arlst;
    }

    public ArrayList getQuest() {
        return quest;
    }

    public void setQuest(ArrayList quest) {
        this.quest = quest;
    }

    public String getQuestions() {
        int w = (new Random()).nextInt(9) + 1, x = (new Random()).nextInt(9) + 1, y = (new Random()).nextInt(9) + 1, z = (new Random()).nextInt(9) + 1;
        titanisu.templates.helperClasses.VariablesHelper mh = new titanisu.templates.helperClasses.VariablesHelper();
        int[] an;
        int den = -1;
        int nom , denom;
        
        float a = (float)w/x,b=(float)y/z;
        System.out.println("a = " + a);
        System.out.println("b = " + b);
        
        quest.add(0, "<math>   <mfrac>  <mi> " + w + " </mi>  <mi> " + x + " </mi>    </mfrac>  <mo>" + "[__]" + " </mo> <mfrac>       <mi> " + y + " </mi>  <mi> " + z + " </mi>    </mfrac>  </math>  ");
        
        if(a<b)
        quest.add(1,"<math>   <mi> Less Than </mi> </math>   ");
        
        if(a>b)
        quest.add(1,"<math>   <mi> Greate Than </mi> </math>   " );
        
        if(a==b)
        quest.add(1,"<math>   <mi> Equals </mi> </math>   ");
        
        setQ(quest);
        
        System.out.println(" quest set in questionGenerator is " + quest);
        return (String) quest.get(0);
    }

    /**
     * Gives the answers
     *
     * @return
     */
    public String getAnswer() {
        return (String) quest.get(1);
    }
}
